from django.conf.urls.defaults import patterns, url
from django.views.generic import DetailView, ListView
from records.models import Game

handler404 = 'records.views.handler404'

urlpatterns = patterns('',
    url(r'^$',
        ListView.as_view(
            queryset=Game.objects.order_by('-date')[:10],
            context_object_name='latest_games_list',
            template_name='records/index.html')),
    url(r'^(?P<pk>\d+)/$',
        DetailView.as_view(
            model=Game,
            template_name='records/detail.html')),
)
